#main-app {
  // --base-menu-bg-color: #eaf3ff;
  --el-menu-text-color: var(--color-primary);

  .main-container {
    height: calc(100vh - 48px);
    transition: margin-left .28s;
    margin-left: $base-sidebar-width;
    position: relative;
  }

  .sidebarHide {
    margin-left: 0 !important;
  }

  .sidebar-container {
    display: flex;
    flex-direction: column;
    -webkit-transition: width .28s;
    transition: width 0.28s;
    width: $base-sidebar-width !important;
    background-color: $base-menu-background;
    background: var(--el-menu-bg-color);
    color: var(--base-text-color);
    height: calc(100vh - 50px);
    position: fixed;
    font-size: 0px;
    top: 45px;
    bottom: 0;
    left: 0;
    z-index: 1001;

    .icon.main-iconfont {
      margin-right: 5px;
      font-size: 20px;
    }

    // box-shadow: 1px 6px 15px rgba($color: #000000, $alpha: .2);

    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0px;
    }

    .el-scrollbar {
      flex: 1;
      height: auto;
      overflow-y: auto;
      &::-webkit-scrollbar{
        width: 1px;
      }
      .el-scrollbar__wrap {
        height: auto;
      }
    }

    .is-horizontal {
      display: none;
    }

    .el-scrollbar .svg-icon+.menu-title {
      margin-left: 16px;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
    }

    .el-menu-item,
    .menu-title {
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;
    }

    // .el-sub-menu .el-menu-item {
    //   height: 40px !important;
    //   line-height: 40px !important;
    // }

    // menu hover
    .sub-menu-title-noDropdown,
    .el-sub-menu__title {
      &:hover {
        background-color: var(--base-menu-bg-color) !important;
      }
    }

    & .theme-dark .is-active>.el-sub-menu__title {
      color: $base-menu-color-active !important;
    }

    & .nest-menu .el-sub-menu>.el-sub-menu__title .menu-title {
      margin-left: 16px;
    }

    & .nest-menu .el-sub-menu>.el-sub-menu__title,
    & .el-sub-menu .el-menu-item {
      min-width: $base-sidebar-width !important;

      &:hover {
        background-color: var(--base-menu-bg-color) !important;
      }
    }

    & .theme-dark .nest-menu .el-sub-menu>.el-sub-menu__title,
    & .theme-dark .el-sub-menu .el-menu-item {
      background-color: $base-sub-menu-background !important;

      &:hover {
        background-color: $base-sub-menu-hover !important;
      }
    }
  }

  .hideSidebar {
    .sidebar-container {
      width: 60px !important;
    }

    .main-container {
      margin-left: 60px;
    }

    .sub-menu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }
      }
    }

    .el-sub-menu {
      overflow: hidden;

      &>.el-sub-menu__title {
        justify-content: center;
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }

      }
    }

    .el-menu--collapse {
      .el-sub-menu {
        &>.el-sub-menu__title {
          &>span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }

          &>i {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }
  }

  .hide {
    .main-container {
      margin-left: 0;
    }

    .hamburger {
      display: none;
    }

    .navbar-left {
      display: none;
    }
  }

  .el-menu--collapse .el-menu .el-sub-menu {
    min-width: $base-sidebar-width !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }

    .sidebar-container {
      transition: transform .28s;
      width: $base-sidebar-width !important;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$base-sidebar-width, 0, 0);
      }
    }
  }

  .withoutAnimation {

    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  &>.el-menu {
    .svg-icon {
      margin-right: 16px;
    }
  }

  .nest-menu .el-sub-menu>.el-sub-menu__title,
  .el-menu-item {
    &:hover {
      // you can use $sub-menuHover
      background-color: rgba(0, 0, 0, 0.06) !important;
    }
  }

  // the scroll bar appears when the sub-menu is too long
  >.el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}

.sidebar-container,
.el-menu--popup-container {
  .el-sub-menu .el-menu-item {
    display: flex;
    position: relative;
    clip-path: inset(0 10px 0 30px round 5px);
    gap: 10px;
    overflow: visible;

    &::before {
      content: '';
      width: 6px;
      height: 100%;
      border-radius: 5px solid red;
      box-sizing: border-box;
    }

    &:hover,
    &.is-active {
      background-color: var(--base-menu-bg-color) !important;
    }
  }

  .el-menu--collapse {
    .el-menu-item {
      clip-path: inset(0 round 5px);
    }

    .is-active {
      &>.el-sub-menu__title {
        background-color: var(--base-menu-bg-color) !important;
      }
    }
  }

  .is-active.submenu-title-noDropdown {
    background-color: var(--base-menu-bg-color) !important;

    &:hover {
      background-color: var(--base-menu-bg-color) !important;
    }

  }

  .is-active>.el-sub-menu__title {
    color: var(--color-primary) !important;
    *{
      color: var(--color-primary) !important;
    }
  }
}
.el-menu--popup-container{
  .el-menu-item{
    height: 40px !important;
    line-height: 40px !important;
  }
}